package com.tencent.compose.sample.mainpage.material3

import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.text.AnnotatedString
import androidx.compose.ui.text.buildAnnotatedString
import org.jetbrains.compose.ui.tooling.preview.Preview

@Composable
@Preview
internal fun TextDemo(
    modifier: Modifier = Modifier
) {
    val annotatedString: AnnotatedString = buildAnnotatedString {
        append("Build better apps faster with ")
    }
    // 使用 Material3 主题样式的 Text 组件
    Text(
        text = annotatedString,
        // 继承主题默认样式
        style = MaterialTheme.typography.bodyLarge,
        // 接收外部修饰符
        modifier = modifier
    )
}